﻿layui.use(['form', 'layer'], function () {
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery, authtree = layui.authtree;

    $(".site-doc-color li").click(function () {
        var taskId = $(this).find(".taskId").val();
        //alert("TaskId : " + taskId);
        openMyTaskDetail(taskId);
    });

    function openMyTaskDetail(taskId) {
        var tit = "任务计划明细";
        var index = layui.layer.open({
            title: tit,
            type: 2,
            anim: 1,
            area: ['100%', '100%'],
            content: "/MyTask/MyTaskDetail?taskId=" + taskId,
            success: function (layero, index) {
                //alert(layero);
                var body = layui.layer.getChildFrame('body', index);
                if (taskId) {
                    body.find("#Id").val(taskId);
                    form.render();
                }
            }
        });
    }

    //$.ajax({
    //    type: 'Get',
    //    url: '/MyTask/Get',
    //    //data: { Ids: ids },
    //    dataType: "json",
    //    headers: {
    //        "X-CSRF-TOKEN-Gerald": $("input[name='AntiforgeryKey_Gerald']").val()
    //    },
    //    success: function (data) {//res为相应体,function为回调函数
    //        console.log(data);
    //        //layer.msg(data.ResultMsg, {
    //        //    time: 2000 //20s后自动关闭
    //        //}, function () {
    //        //    tableIns.reload();
    //        //});
    //        //layer.close(index);
    //    },
    //    error: function (XMLHttpRequest, textStatus, errorThrown) {
    //        layer.alert('操作失败！！！' + XMLHttpRequest.status + "|" + XMLHttpRequest.readyState + "|" + textStatus, { icon: 5 });
    //        layer.close(index);
    //    }
    //});
    var processList = $(".progress");
    $.each(processList, function () {
        var progressVal = $(this).find("input").val();
        console.log(progressVal);
        $(this).circleProgress({
            max: 100,
            value: progressVal
        });
    });
});